/*********************************************************
          File Name:stack.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Tue 15 Sep 2015 11:05:00 AM CST
**********************************************************/

#include <iostream>
using namespace std;

#include <stack>

int main()
{
        stack<string> st;

        string s;

        while(getline(cin,s))
        {
                st.push(s);
                cin.clear();
        }

        while(!st.empty())
        {
                cout << st.top() << endl;
                st.pop();
        }
        return 0;
}
